let movieDao = require("../Dao/movieDao.js");
let resultUtil = require("../util/ResultUtil.js");

async function list(filter,page=1,limit=10,sort="_id"){
    let data = await movieDao.getMovies(filter,page,limit,sort);
    // console.log(data);
    let count = await movieDao.movieCount(filter)
    let result = resultUtil(data,count);
    // console.log("----------"+result);
    return result;
}

module.exports.list = list;